package dai.noui

import dai.core.base.ShaderProgram
import org.joml.Matrix4f
import v1.*

class CubeRender(shader:ShaderProgram,mesh: Mesh): RenderItem(shader,mesh = mesh) {
    override fun render(projMatrix: Matrix4f, viewMatrix: Matrix4f) {
        tmpModelViewMatrix.set(viewMatrix).mul(worldMatrix)

        shader.bind()
        shader.setUniform("projectMatrix",projMatrix)
        shader.setUniform("modelViewMatrix",tmpModelViewMatrix)
        mesh.render()
        shader.unbind()
    }
}

fun main(){
    val camera = Camera()
    camera.position.z = 5f

    val window = Window()
    val renderer = Renderer()
    val scene = V1Scene()
    val game = GameApp(scene = scene,window = window,camera = camera,renderer = renderer)
    game.launch()
}

